package gui;

import java.awt.*;
import javax.swing.*;

public class SimpleFrame extends JFrame
{
	private		JTabbedPane tabbedPane;
	private		JPanel		panelICC;
	private		JPanel		panelIC;
	private		JPanel		panelApplicationIdentification;


	public SimpleFrame()
	{
		// NOTE: to reduce the amount of code in this example, it uses
		// panels with a NULL layout.  This is NOT suitable for
		// production code since it may not display correctly for
		// a look-and-feel.
		
		setTitle( "Tabbed Pane Application" );
		setSize( 300, 200 );
		setBackground( Color.gray );

		JPanel topPanel = new JPanel();
		topPanel.setLayout( new BorderLayout() );
		getContentPane().add( topPanel );

		// Create the tab pages
		createPage1();
		createPage2();
		createPage3();

		// Create a tabbed pane
		tabbedPane = new JTabbedPane();
		tabbedPane.addTab( "ICC", panelICC );
		tabbedPane.addTab( "IC", panelIC );
		tabbedPane.addTab( "Application Identification", panelApplicationIdentification );
		topPanel.add( tabbedPane, BorderLayout.CENTER );
	}

	public void createPage1()
	{
		panelICC = new JPanel();
		panelICC.setLayout( null );

		JLabel label1 = new JLabel( "Clock stop:" );
		label1.setBounds( 10, 15, 150, 20 );
		panelICC.add( label1 );

		JTextField field = new JTextField();
		field.setBounds( 10, 35, 150, 20 );
		panelICC.add( field );

		JLabel label2 = new JLabel( "Password:" );
		label2.setBounds( 10, 60, 150, 20 );
		panelICC.add( label2 );

		JPasswordField fieldPass = new JPasswordField();
		fieldPass.setBounds( 10, 80, 150, 20 );
		panelICC.add( fieldPass );
	}

	public void createPage2()
	{
		panelIC = new JPanel();
		panelIC.setLayout( new BorderLayout() );

		panelIC.add( new JButton( "North" ), BorderLayout.NORTH );
		panelIC.add( new JButton( "South" ), BorderLayout.SOUTH );
		panelIC.add( new JButton( "East" ), BorderLayout.EAST );
		panelIC.add( new JButton( "West" ), BorderLayout.WEST );
		panelIC.add( new JButton( "Center" ), BorderLayout.CENTER );
	}

	public void createPage3()
	{
		panelApplicationIdentification = new JPanel();
		panelApplicationIdentification.setLayout( new GridLayout( 3, 2 ) );

		panelApplicationIdentification.add( new JLabel( "Field 1:" ) );
		panelApplicationIdentification.add( new TextArea() );
		panelApplicationIdentification.add( new JLabel( "Field 2:" ) );
		panelApplicationIdentification.add( new TextArea() );
		panelApplicationIdentification.add( new JLabel( "Field 3:" ) );
		panelApplicationIdentification.add( new TextArea() );
	}
}
